Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chnl: add chnl_port to get port from connected channel #388

Merged
merged 2 commits into from
Jul 30, 2024

Conversation

jalalmostafa
Copy link
Contributor

This PR adds a new chnl_port API function, allowing us to know which port this channel is bound to.
It is important to allocate mbufs when sending data e.g.

pktmbuf_t* bufs[256];
int portid = chnl_port(cd);
pktdev_buf_alloc(portid, bufs, burst);
chnl_send(cd, bufs, burst);

This can be easily done as the PCB entry will be linked to a specific port (interface and queue) in the FIB when the connection has been established chnl_accept or chnl_connect has finished.

Copy link
Contributor

@KeithWiles KeithWiles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@KeithWiles KeithWiles merged commit 9414578 into CloudNativeDataPlane:main Jul 30, 2024
7 checks passed
@jalalmostafa jalalmostafa deleted the chnl-port branch August 6, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants